FROM alpine:3.22.0

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk add --no-cache openvpn iptables openssl && \
echo "tun" >> /etc/modules-load.d/tun.conf && \
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.d/ipv4.conf

COPY ./start.sh ./

COPY ./dist /opt/dist

COPY ./ovpnc /opt/ovpnc

COPY ./conf /opt/conf

COPY ./openvpn /etc/openvpn

CMD ["sh","-c","./start.sh"]
